from symbol import term


type = int(input("请选择贷款类型：1.商业贷款 2.公积金贷款 3.组合贷款\n"))
if type !='3':
    amount = float(input("请输入贷款金额(万)\n"))
    trem = int(input("请选择期限（年）：5、10、15、20、25\n"))
    if trem in [5,10,15,20,25]:
        if trem == 5:
            rate = (4.75/100)/12
            pay = amount * 10000 * (rate*((1+rate)**(term*(1+rate)**(trem*12)))/(((1+rate)**(term*12)))-1)
            zpay = pay * term * 12
            interest = zpay - amount * 10000
            print("每月月供参考（元）：{:.f}元".format(pay))
            print("支付利息（元）：{:.f}元".format(interest))
            print("还款总额（元）{:.f}元".format(zpay))
        else:
            if type == "1":
                rate = (4.90/100)/12
                pay = amount * 10000 * (rate*((1+rate)**(term*(1+rate)**(trem*12)))/(((1+rate)**(term*12)))-1)
                zpay = pay * term * 12
                interest = zpay - amount * 10000
                print("每月月供参考（元）：{:.f}元".format(pay))
                print("支付利息（元）：{:.f}元".format(interest))
                print("还款总额（元）{:.f}元".format(zpay))
            elif type == "2":
                if term == 5:
                    rate = (2.75/100)/12
                else:
                    rate = (3.25/100)/12
                    pay = amount * 10000 * (rate*((1+rate)**(term*(1+rate)**(trem*12)))/(((1+rate)**(term*12)))-1)
                    zpay = pay * term * 12
                    interest = zpay - amount * 10000
                    print("每月月供参考（元）：{:.f}元".format(pay))
                    print("支付利息（元）：{:.f}元".format(interest))
                    print("还款总额（元）{:.f}元".format(zpay))
            else:
                print("请输入合法的期限")
    # else:
    #     bloan = float(input("请输入商业贷款金额（万）：\n"))
    #     floan = float(input("请输入公积金贷款金额（万）：\n"))
    #     trem = int(input("请选择期限（年）：5、10、15、20、25\n"))
    #     if trem in [5,10,15,20,25]:
    #         brate = (4.75/100)/12
    #         frate = (2.75/100)/12